package com.googlecode.afx.view.binding;

import java.util.HashMap;
import java.util.Map;

import com.googlecode.afx.view.NodeHandler;

import javafx.scene.Node;

public class BindingCapableNodeHandler implements NodeHandler {

	private Map<String, Node> nodeMap = new HashMap<String, Node>();
	
	public BindingCapableNodeHandler() {
	}
	
	@Override
	public void process(Node node) {
		String id = node.getId();
		if(id != null && DatabindingUtils.supportsPrimaryValue(node)) {
			this.nodeMap.put(id, node);
		}
	}

	public Map<String, Node> getNodeMap() {
		return nodeMap;
	}

	public void setNodeMap(Map<String, Node> nodeMap) {
		this.nodeMap = nodeMap;
	}
}
